package sdfi.lee.Entity.base;

import java.io.Serializable;
import java.util.HashSet;


/**
 * This is an object that contains data related to the notice table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="notice"
 */

public abstract class BaseNotice  implements Serializable {

	public static String REF = "Notice";
	public static String PROP_NOTICECONTENT = "noticecontent";
	public static String PROP_NOTICEDATE = "noticedate";
	public static String PROP_NOTICETITLE = "noticetitle";
	public static String PROP_ID = "id";


	// constructors
	public BaseNotice () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseNotice (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseNotice (
		java.lang.Integer id,
		java.lang.String noticetitle,
		java.util.Date noticedate) {

		this.setId(id);
		this.setNoticetitle(noticetitle);
		this.setNoticedate(noticedate);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String noticetitle;
	private java.util.Date noticedate;
	private java.lang.String noticecontent;

	// collections
	private java.util.Set<sdfi.lee.Entity.Noticefile> noticefiles=new HashSet<sdfi.lee.Entity.Noticefile>();



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: noticetitle
	 */
	public java.lang.String getNoticetitle () {
		return noticetitle;
	}

	/**
	 * Set the value related to the column: noticetitle
	 * @param noticetitle the noticetitle value
	 */
	public void setNoticetitle (java.lang.String noticetitle) {
		this.noticetitle = noticetitle;
	}



	/**
	 * Return the value associated with the column: noticedate
	 */
	public java.util.Date getNoticedate () {
		return noticedate;
	}

	/**
	 * Set the value related to the column: noticedate
	 * @param noticedate the noticedate value
	 */
	public void setNoticedate (java.util.Date noticedate) {
		this.noticedate = noticedate;
	}



	/**
	 * Return the value associated with the column: noticecontent
	 */
	public java.lang.String getNoticecontent () {
		return noticecontent;
	}

	/**
	 * Set the value related to the column: noticecontent
	 * @param noticecontent the noticecontent value
	 */
	public void setNoticecontent (java.lang.String noticecontent) {
		this.noticecontent = noticecontent;
	}



	/**
	 * Return the value associated with the column: noticefiles
	 */
	public java.util.Set<sdfi.lee.Entity.Noticefile> getNoticefiles () {
		return noticefiles;
	}

	/**
	 * Set the value related to the column: noticefiles
	 * @param noticefiles the noticefiles value
	 */
	public void setNoticefiles (java.util.Set<sdfi.lee.Entity.Noticefile> noticefiles) {
		this.noticefiles = noticefiles;
	}

	public void addTonoticefiles (sdfi.lee.Entity.Noticefile noticefile) {
		if (null == getNoticefiles()) setNoticefiles(new java.util.TreeSet<sdfi.lee.Entity.Noticefile>());
		getNoticefiles().add(noticefile);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof sdfi.lee.Entity.Notice)) return false;
		else {
			sdfi.lee.Entity.Notice notice = (sdfi.lee.Entity.Notice) obj;
			if (null == this.getId() || null == notice.getId()) return false;
			else return (this.getId().equals(notice.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}